//@author wtfumlomglol
package amm.Graphic;

//a jatek idoziteseert felelos osztaly
//nem a skeleton resze
public class Ticker extends Thread {

    private Game g;
    private int time=0;
    private int halftime=0;

    @Override
    public void run() {
        while (g.isRunning()) {
            try {
                sleep(500);
                g.tick();
                if(halftime%2==0) time++;
                halftime++;
            } catch (InterruptedException e) {
            }
        }
    }

    public Ticker(Game game) {
        g = game;
    }

    public void tick() {
        start();
    }

    public int gettime(){
        return time;
    }
}
